/*Drop trait 超出作用域自动调用*/

struct CustomSmartPointer{
    data: String,
}
impl Drop for CustomSmartPointer{
    fn drop(&mut self) {
       println!("Dropping CustomSmartPointer!")
    }
}
pub fn drop_demo(){
    let c = CustomSmartPointer{data: String::from("hello")};
    drop(c); //可以手动drop
    let d = CustomSmartPointer{data: String::from("world")};
}